<%= form_for_channel channel do |f| -%>
  <%= render 'edit_header', :f => f, :on_direction_change => 'clickatell_channel_direction_changed()', :exclude_address => true -%>
  <p id="user_container">
  <%= f.label :user -%><br/>
  <%= f.text_field :user, :autocomplete => :off -%>
  </p>
  <p id="password_container">
  <%= f.label :password -%> (this is the password of your account)<br/>
  <%= f.password_field :password, :autocomplete => :off -%>
  </p>
  <p>
  <%= f.label :api_id, 'Api ID' -%><br/>
  <%= f.text_field :api_id -%>
  </p>
  <p id="from_container">
  <%= f.label :from -%><br/>
  <%= f.text_field :from -%>
  </p>
  <p id="network">
  <%= f.label :network -%><br/>
  <%= f.select :network, options_for_select(ClickatellChannel::CLICKATELL_NETWORKS.map {|v,d| [d,v]}, channel.network)%>
  </p>
  <p id="concat_container">
  <%= f.label :concatenation -%><br/>
  <%= f.text_field :concat, :value => channel.concat || 3 -%>
  </p>
  <p id="callback_incoming">
  Callback urls for incoming messages (use <a href="http://en.wikipedia.org/wiki/Basic_access_authentication" target="_blank">Basic Http Authentication</a> with channel name and incoming password):<br/>
  <code><%= clickatell_url(:account_id => account.name) -%></code><br/>
  </p>
  <p id="callback_ack">
  Callback urls for status notification (use <a href="http://en.wikipedia.org/wiki/Basic_access_authentication" target="_blank">Basic Http Authentication</a> with channel name and incoming password):<br/>
  <code><%= clickatell_ack_url(:account_id => account.name) -%></code><br/>
  </p>
  <p>
  <%= f.label :incoming_password -%> (to use for the callback urls)<br/>
  <%= f.password_field :incoming_password, :autocomplete => :off -%>
  </p>
  <h5>Costs</h5>
  <p>
  <%= f.label :cost_per_credit -%> (messages will get a 'cost' custom attribute with the value <code>charge * cost_per_credit</code>)<br/>
  <%= f.text_field :cost_per_credit, :value => channel.cost_per_credit || 1 -%>
  </p>
  <%= render 'edit_footer', :f => f, :exclude_costs => true %>
<%- end -%>

<script>
clickatell_channel_direction_changed();
</script>
